<?php $__env->startSection('title','教学建设成果上传'); ?>
<?php $__env->startSection('css'); ?>
<link href="<?php echo e(asset(getThemeAssets('css/toastr.min.css'))); ?>" rel="stylesheet">
<style type="text/css">
    .widget .row span{
      font-size: 15px;
      font-weight: bold;
    }
    .p-md{
        padding-top: 6px;
        padding-bottom: 0px;
        margin-top: 0px;
        margin-bottom: 30px;
    }
    .m-b-md{
        padding-top: 3px;
    }
    .page-heading{
        padding-bottom: 2px;
    }
    .alert{
        /*padding-bottom: 0px;*/
        padding-left: 23px;
        padding-right: 23px;
        margin-bottom: 0px;
    }
    .alert p{
        font-size: 14px;
        font-weight: 12px;
    }
    .alert a{
        text-decoration: underline;
    }
    .canceled{
        margin: 0;
        padding: 0;
    }
    #login-form {
        margin-top: 30px;
    }
    #login-form img{
        width: 100%;
        margin-left: 0;
    }
    #footerrow {
      margin-top: 100px;
    }
    .col-sm-6 {
      padding: 3px;
    }
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>

<div class="row wrapper border-bottom page-heading">
  <div class="col-sm-10">
    <h2><?php echo trans('upload.ConstructionTitle'); ?></h2>
    <ol class="breadcrumb">
        <li>
            <a href="<?php echo e(url('admin')); ?>"><?php echo trans('home.title'); ?></a>
        </li>
        <li class="active">
            <strong><?php echo trans('upload.ConstructionTitle'); ?></strong>
        </li>
    </ol>
  </div>
  <div class="col-sm-2">
    <div class="title-action">
      <a class="btn btn-primary btn-block" href="<?php echo e(url('/admin/upload/uploadConstrExcel')); ?>"><i class="fa fa-reply"></i>切换Excel方式上传</a>
    </div>
  </div>
</div>
<div id="login-form">
    <div class="logo">
        <img id="logo" src="<?php echo e(asset(getThemeAssets('img/logo2.png'))); ?>">
    </div>
    <div class="row">
        
      <form class="form-horizontal" id="awardinfo" enctype="multipart/form-data" method="" action="">
      <?php echo e(csrf_field()); ?>

        <div class="col-lg-offset-3 col-lg-6">
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-user"></span> -->
              <label>教师姓名：</label>
            </div>
            <input type="text" class="form-control" id="username" name="username"
                    placeholder="<?php echo e(auth()->user()->name); ?>" disabled="true" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-user"></span> -->
              <label>职工编号：</label>

            </div>
            <input type="text" class="form-control" id="username" name="username"
                    placeholder="<?php echo e(auth()->user()->jobnumber); ?>" disabled="true" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-star"></span> -->
              <label>项目编号：</label>

            </div>
            <input type="text" class="form-control" id="project_id" name="project_id" placeholder="" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-star"></span> -->
              <label>项目名称：</label>

            </div>
            <input type="text" class="form-control" id="project_name" name="project_name" placeholder="" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-star"></span> -->
              <label>项目分类：</label>

            </div>
            <select class="form-control" id="category" name="category">
                <option class="form-control" value ="专业建设">专业建设</option>
                <option class="form-control" value ="课程建设">课程建设</option>
                <option class="form-control" value="教材建设">教材建设</option>
                <option class="form-control" value="教改建设">教改建设</option>
              </select>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-time"></span> -->
              <label>具体类别：</label>

            </div>
            <select class="form-control" id="level" name="level">
                <option class="form-control" value ="品牌专业">品牌专业</option>
                <option class="form-control" value ="重点专业">重点专业</option>
                <option class="form-control" value ="专业建设业绩分">专业建设业绩分</option>
                <option class="form-control" value ="教改示范课程">教改示范课程</option>
                <option class="form-control" value ="在线开放课程">在线开放课程</option>
                <option class="form-control" value ="讲义">讲义</option>
                <option class="form-control" value ="教材">教材</option>
                <option class="form-control" value ="国家级教学改革研究课题">国家级教学改革研究课题</option>
                <option class="form-control" value ="全国教育科学规划课题国家级课题">全国教育科学规划课题国家级课题</option>
                <option class="form-control" value ="国家级教学改革研究课题（一般）">国家级教学改革研究课题（一般）</option>
                <option class="form-control" value ="全国教育科学规划课题教育部课题">全国教育科学规划课题教育部课题</option>
                <option class="form-control" value ="江苏省教学改革研究课题（重中之重）">江苏省教学改革研究课题（重中之重）</option>
                <option class="form-control" value ="江苏省教学改革研究课题（重点）">江苏省教学改革研究课题（重点）</option>
                <option class="form-control" value ="江苏省教学改革研究课题（一般）">  
江苏省教学改革研究课题（一般）</option>
                <option class="form-control" value ="江苏省教育科学规划课题">  
江苏省教育科学规划课题</option>
                <option class="form-control" value ="江苏省研究生教育教学改革研究与实践课题">江苏省研究生教育教学改革研究与实践课题</option>
                <option class="form-control" value ="江苏省信息化课题">江苏省信息化课题</option>
                <option class="form-control" value ="镇江市教育专项课题">镇江市教育专项课题</option>
                <option class="form-control" value ="江苏科技大学教学改革研究课题">  
江苏科技大学教学改革研究课题</option>
                <option class="form-control" value ="苏理工教学改革研究课题">苏理工教学改革研究课题-重点</option>
                <option class="form-control" value ="苏理工教学改革研究课题">苏理工教学改革研究课题-一般</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-tag"></span> -->
              <label>立项年度：</label>

            </div>
            <input type="date" class="form-control" id="create_year" name="create_year" placeholder="格式：2018" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-star"></span> -->
              <label>项目级别：</label>

            </div>
            <select class="form-control" id="place_level" name="place_level">
                <option class="form-control" value ="苏理工">苏理工</option>
                <option class="form-control" value ="江科大">江科大</option>
                <option class="form-control" value="市级">市级</option>
                <option class="form-control" value="省级">省级</option>
                <option class="form-control" value="国家级">国家级</option>
                <option class="form-control" value="无">无</option>
              </select>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-star"></span> -->
              <label>建议经费：</label>

            </div>
            <input type="text" class="form-control" id="proposed_fund" name="proposed_fund" placeholder="单位为万元" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-star"></span> -->
              <label>其他成员：</label>

            </div>
            <input type="text" class="form-control" id="allusers" name="allusers" placeholder="成员以逗号分割，可以为空" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-time"></span> -->
              <label class="input-group">是否结束：</label>

            </div>
            <select class="form-control" id="hasfinished">
                <option class="form-control" value ="1">是</option>
                <option class="form-control" value ="0">否</option>
              </select>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-time"></span> -->
              <label>业绩分计算科室：</label>

            </div>
            <input type="text" class="form-control" id="perfor_score_room" name="perfor_score_room" placeholder="" disabled="true" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-time"></span> -->
              <label class="input-group">业绩分：</label>

            </div>
            <input type="text" class="form-control" id="perfor_score" name="perfor_score" placeholder=""  disabled="true" required>
          </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <!-- <span class="glyphicon glyphicon-time"></span> -->
              <label class="input-group">归档文件号：</label>

            </div>
            <input type="text" class="form-control" id="archive_number" name="archive_number" placeholder="" disabled="true" required>
          </div>
        </div>

        </div>
        
        <div class="form-group">
          <div class="col-sm-12 ">
            
            <div class="col-sm-offset-3 col-sm-3">
                <button type="button" id="submitbtn" class="btn btn-primary btn-block">确认提交教学建设记录</button>
            </div>
            <div class="col-sm-3">
                <a href="<?php echo e(url('/admin/upload/uploadConstrExcel')); ?>">
                <button type="button" class="btn btn-primary btn-block">切换为Excel文件上传</button>
                </a>
            </div>
          </div>
        </div>
      </form>
  </div>
</div>
                        

<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<script src="<?php echo e(asset(getThemeAssets('js/toastr.min.js'))); ?>"></script>
<script type="text/javascript">
    $(document).ready(function()  {
      // 上传事件监听
      $("#submitbtn").click(function() {
          var awardInfo = [];
          awardInfo['project_id'] = $("#project_id").val();
          awardInfo['project_name'] = $("#project_name").val();
          awardInfo['category'] = $("#category").val();
          awardInfo['level'] = $("#level").val();
          awardInfo['create_year'] = $("#create_year").val();
          awardInfo['place_level'] = $("#place_level").val();
          awardInfo['place_level'] = $("#place_level").val();
          awardInfo['proposed_fund'] = $("#proposed_fund").val();
          awardInfo['allusers'] = $("#allusers").val();
          awardInfo['hasfinished'] = $("#hasfinished").val();
          if (awardInfo['project_id'] == '') {
              swal("项目编号不能为空","","warning");
              return;
          }
          if (awardInfo['project_name'] == '') {
              swal("项目名称不能为空","","warning");
              return;
          }
          if (awardInfo['create_year'] == '') {
              swal("立项年度不能为空！","","warning");
              return;
          }else {
              var time_vali = /^[0-9]{4}$/;
              if (!time_vali.exec(awardInfo['create_year'])) {
                  swal("请检查立项年度填写格式！","","warning");
                  return;   
              }
          }
          if (awardInfo['proposed_fund'] == '') {
              swal("建议经费大于等于0！","","warning");
              return;
          }
          console.log(awardInfo);
          // 实例化表单数据对象
          var formData = new FormData();
          formData.append('project_id',awardInfo['project_id']);
          formData.append('project_name',awardInfo['project_name']);
          formData.append('category',awardInfo['category']);
          formData.append('level',awardInfo['level']);
          formData.append('create_year',awardInfo['create_year']);
          formData.append('place_level',awardInfo['place_level']);
          formData.append('proposed_fund',awardInfo['proposed_fund']);
          formData.append('allusers',awardInfo['allusers']);
          formData.append('hasfinished',awardInfo['hasfinished']);
          console.log(formData);
          // ajax请求，向数据库进行信息提交
          $.ajaxSetup ({
                     headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
            });

          $.ajax({
              url: "<?php echo e(url('/admin/upload/uploadconstruction')); ?>",
              type: 'post',
              data: formData,
              processData: false,
              contentType: false, 
              success: function(res) {
                  if (res['res'] == 1) {
                      swal("上传教学建设记录成功！请到个人档案进行核对！","","success");
                      $("#project_id").val("");
                      $("#project_name").val("");
                      $("#create_year").val("");
                      $("#proposed_fund").val("");
                      $("#allusers").val("");
                  }else {
                      swal("上传失败！请联系管理员！","","warning");
                  }
              }
          });

      });
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.'.getTheme(), array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>